package LeetCode刷题;

import java.util.Arrays;

/**
 * @program: Java_Study
 * @author: Xiaofan
 * @createTime: 2021-11-13 11:42
 * @description: Functions of this class is
 **/
public class 最大数 {
    public static void main(String args[]){
        Arrays.sort(new String[]{"1","20"},(String s1,String s2)->((s1+s2).compareTo(s2+s1)));
    }
    /**
     * class Solution {
     *     public String largestNumber(int[] nums) {
     *         int len=nums.length;
     *         String strs[]=new String[len];
     *         for(int i=0;i<len;i++){
     *             strs[i]=String.valueOf(nums[i]);
     *         }
     *         Arrays.sort(strs,(s1,s2)->(s2+s1).compareTo(s1+s2));
     *         String ans="";
     *         if(strs[0].equals("0")){
     *             return "0";
     *         }
     *         for(String str:strs){
     *             ans+=str;
     *         }
     *         return ans;
     *     }
     * }
     *
     */
}